Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For RN there is not a Crypto library.
So we should use expo-crypto and make an alias to crypto
RN Config
Install Bable Module Resolver
Update babel.config.js
module.exports = function (api) { api.cache(true); return { presets: ["babel-preset-expo"], plugins: [ [ "module-resolver", { alias: { crypto: "expo-crypto", }, }, ], ], }; };
So we are telling to RN that the crypto lib is expo-crypto insted of crypto, the fact is expo-crypto has different methods, so we need to verify if is RN or Brower/Node then if is react native call the methods from expo.
There is an issue, navigator.product its depreacted, but other that this config works as expect and all test passed